﻿$(function () {

    $(".round").on("tap", function () {
        var btn = $(this);
        btn.addClass("hovercss");

    });

    $(document).on("pagehide", "#indexpage", function () { // When leaving pagetwo
        $(".round").removeClass("hovercss");
    });



    var count = document.getElementById("thelist").getElementsByTagName("img").length;

    var count2 = document.getElementsByClassName("menuimg").length;

    for (i = 0; i < count; i++) {
        document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
    }

    document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";

    setInterval(function () {
        myScroll.scrollToPage('next', 0, 400, count);
    }, 3500);

    window.onresize = function () {
        for (i = 0; i < count; i++) {
            document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
        }
        document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
    }
});